const { defineConfig } = require('@vue/cli-service')
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
const webpack = require('webpack')
module.exports = defineConfig({
  pages: {
    index: {
      entry:'src/main.js',
      title:'3D海上风机姿态展示',
    }
  },
  transpileDependencies: true,
  configureWebpack: {
    // const plugins =[]
    // plugins.push(new NodePolyfillPlugin())
    // plugins.push(new webpack.ProvidePlugin({
    //   process:"process/browser",
    //   Buffer:['buffer','Buffer']
    // }))

    plugins: [
      new NodePolyfillPlugin(),
      new webpack.ProvidePlugin({
        process: "process/browser",
        Buffer: ['buffer', 'Buffer']
      })
    ]
  },
  lintOnSave: false,
  devServer: {
    // proxy: {
    //   '^/api': {
    //     target: "http://localhost:8889",
    //     ws: true,//代理websocked
    //     changeOrigin: true,//虚拟的站点需要更管origin
    //     pathRewrite: {
    //       '^/api': ''//重写路径
    //     }
    //   }
    // }
  }
})
